home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / buildy1a / vsplit.cls < prev    next >
Encoding:
Visual Basic class definition  |  1999-09-07  |  2.8 KB  |  133 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "vSplit"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. 'This Object module will be compiled into part of the
  11. 'binary file that our test project will use to set
  12. 'properties for the objects on the form.
  13. '
  14. 'This Object module will control the Vertical Splitter
  15. Option Explicit
  16. 'These are the local variable(s)
  17. 'to hold property value(s)
  18. Private mHostPane As Object ' local copy
  19. Private mLeftPane As Object ' local copy
  20. Private mRightPane As Object ' local copy
  21. Private mSplitBar As Object ' local copy
  22. Private mSplitOn As Boolean ' local copy
  23.  
  24. ' Here we set the "HostPane" as an object so that the
  25. ' dll can manipulate it's properties.
  26. ' Why do this?  The answer is simple,  When your app
  27. ' achives binary reuse, then you can change the dll
  28. ' without having to change the hardcode in the exe.
  29. ' this makes distributing "updates" simple and smaller
  30. ' in file size.
  31. Public Property Get HostPane() As Object
  32.   '
  33.   Set HostPane = mHostPane
  34.   '
  35. End Property
  36.  
  37. Public Property Set HostPane(ByVal vData As Object)
  38.   '
  39.   Set mHostPane = vData
  40.   '
  41. End Property
  42.  
  43. Public Property Get RightPane() As Object
  44.   '
  45.   Set RightPane = mRightPane
  46.   '
  47. End Property
  48.  
  49. Public Property Set RightPane(ByVal vData As Object)
  50.   '
  51.   Set mRightPane = vData
  52.   '
  53. End Property
  54.  
  55. Public Property Get LeftPane() As Object
  56.   '
  57.   Set LeftPane = mLeftPane
  58.   '
  59. End Property
  60.  
  61. Public Property Set LeftPane(ByVal vData As Object)
  62.   '
  63.   Set mLeftPane = vData
  64.   '
  65. End Property
  66.  
  67. Public Property Get SplitBar() As Object
  68.   '
  69.   Set SplitBar = mSplitBar
  70.   '
  71. End Property
  72.  
  73. Public Property Set SplitBar(ByVal vData As Object)
  74.   '
  75.   Set mSplitBar = vData
  76.   '
  77. End Property
  78.  
  79. Public Property Get SplitOn() As Boolean
  80.   '
  81.   SplitOn = mSplitOn
  82.   '
  83. End Property
  84.  
  85. Public Property Let SplitOn(ByVal vData As Boolean)
  86.   '
  87.   mSplitOn = vData
  88.   '
  89. End Property
  90.  
  91. Public Sub SetPointer(ByVal pType As Integer)
  92.   '
  93.   mHostPane.MousePointer = pType
  94.   '
  95. End Sub
  96.  
  97. Public Sub ResizePanes(Optional Twips As Single)
  98.   '
  99.   On Error GoTo localerr
  100.   '
  101.   If IsMissing(Twips) Then
  102.     Twips = 0
  103.   End If
  104.   '
  105.   With mSplitBar
  106.     .Top = 0
  107.     .Left = .Left + Twips
  108.     .Height = mHostPane.ScaleHeight
  109.     .Width = 30
  110.   End With
  111.   '
  112.   With mLeftPane
  113.     .Top = 0
  114.     .Left = 0
  115.     .Height = mHostPane.ScaleHeight
  116.     .Width = mSplitBar.Left
  117.   End With
  118.   '
  119.   With mRightPane
  120.     .Top = 0
  121.     .Left = mSplitBar.Left + mSplitBar.Width
  122.     .Height = mHostPane.ScaleHeight
  123.     .Width = mHostPane.ScaleWidth - _
  124.           (mLeftPane.Width + mSplitBar.Width)
  125.   End With
  126.   '
  127.   Exit Sub
  128.   '
  129. localerr:
  130.    'ignore any errors
  131. End Sub
  132.  
  133.